package cn.crex1.xiaomi.core.mvc.beans.config;

import java.lang.reflect.Method;

import cn.crex1.xiaomi.core.mvc.annotation.RequestMapping;
import cn.crex1.xiaomi.core.mvc.beans.BeanMetadata;

public class BeanMethodMetadata implements BeanMetadata {
	
	private String beanMethodName;
	
	private Method beanMethod;
	
	@Override
	public String getTyeName() {
		return beanMethodName;
	}

	@Override
	public Object getTyeClass() {
		return beanMethod;
	}

	@Override
	public Object getModifierType() {
		return null;
	}
	
	/**
	 * 获取bean上的方法名
	 */
	@Override
	public void setTyeName(Object beanMethod) {
		Method method=(Method) beanMethod;
		if (BeanDefinitionUtil.isAnnotation(RequestMapping.class, method)) {
			this.beanMethodName=method.getName();			
		}
	}

	@Override
	public void setTyeClass(Object beanClass) {
		this.beanMethod=(Method) beanMethod;
	}

	@Override
	public void setModifierType(Object beanClass) {
		
	}

}
